#ifndef QHOSTOBJECTMAP_H
#define QHOSTOBJECTMAP_H

#include <QString>
#include <QList>
#include <QStringList>
#include <QMetaMethod>

#define HAS_NEXT 1
#define FUNCTION_NO_PARAM 2
#define FUNCTION_PARAM  4
#define FUNCTION_NO_RETURN 8
#define FUNCTION_RETURN 16

namespace SHAREDLIB
{
    class QAbstractHost;
    class QAbstractProperty;
}

namespace CORELIB
{

    struct tagObjectInfo
    {
        QString                 m_name;
        tagObjectInfo*          m_parent;
        SHAREDLIB::QAbstractHost    *m_host;
        QMetaMethod             m_method;
        QList<tagObjectInfo*>   m_children;
    };

    class QHostObjectMap
    {
    public:
        QHostObjectMap(SHAREDLIB::QAbstractProperty *property,SHAREDLIB::QAbstractHost *host);


        void        make_host(SHAREDLIB::QAbstractHost *host, tagObjectInfo *info);

        tagObjectInfo* make_info(SHAREDLIB::QAbstractHost *host);

        QList<tagObjectInfo*>  get_info(const QString &text);

        QList<tagObjectInfo*>  get_info_same(const QString &text);

        tagObjectInfo*          get(tagObjectInfo *info,const QString& name);

        bool        check(const QString &name,tagObjectInfo *info);

    protected:
        void    sort(QList<tagObjectInfo*>  &list);
    protected:
        tagObjectInfo       m_root;
        QStringList         m_list;
    };

}

#endif // QHOSTOBJECTMAP_H
